using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
using System.Runtime.Serialization;

namespace DiskGarden
{
	[Serializable]
	public class VolumeNode : DirectoryNode
	{
		[XmlAttribute("volType")]
		public VolumeType VolType;

		public VolumeNode()	: base()
		{
			this.type = NodeType.Volume;
		}

		public override void Move(CategoryNode newParent)
		{
			CategoryNode parent = this.Parent as CategoryNode;
			if (newParent != parent)
			{
				parent.Volumes.Remove(this);
				newParent.Volumes.Add(this);
				this.Parent = newParent;
				Root.InvokeNodeMoved(this);
			}
		}

		internal override void WriteXml(System.Xml.XmlWriter xml)
		{
			base.WriteXml(xml);
			//xml.WriteAttributeString("volType", VolType.ToString());
		}
	}
}
